<?php
include("template_top.php");
if(isset($_POST['fname'])){
	customerSignIn($_POST['fname']." ".$_POST['lname'], $_POST['reason']);
	addActivity($_POST['fname']." ".$_POST['lname']." was signed in for ".$_POST['reason']);
	$_GET['msg'] = $_POST['fname']." ".$_POST['lname']." Was Signed In Successfully";
}
?><h1>Customer Sign In Center</h1>
<p>
<table width="100%">
<tr>
<td width="50%">
	<h4>Sign In A Customer</h4>
	<form action="Customer_Signin_Center.php" method="POST">
	<table width="100%" cellpadding="0" cellspacing="5">
	<tr>
    	<td width="200" align="right">
			First Name:
        </td>
        <td>
        	<input type="text" name="fname" style="width:97%" />
        </td>
    </tr>
    <tr>
    	<td width="200" align="right">
        	Last Name:
        </td>
        <td>
			<input type="text" name="lname" style="width:97%" />
        </td>
    </tr>
    <tr>
    	<td width="200" valign="top" align="right">
        	Reason For Visit:
        </td>
        <td>
            <select id="reason" name="reason" style="width:98%">
                    <option value="0" selected="selected">Please Choose...</option>
                    <option value="Computer Logon Support">Computer Logon Support (Staff)</option>
                    <option value="Computer Logon Support">Computer Logon Support (Student)</option>
                    <option value="Document Scanning">Document Scanning</option>
                    <option value="eLearning Support">eLearning Support</option>
                    <option value="K-Lab Help">K-Lab Help</option>
                    <option value="New Student Support">New Student</option>
                    <option value="Personal Computer Help">Personal Computer Help</option>
                    <option value="Portal or E-Mail">Portal / Email Issues</option>
                    <option value="Registration Assistance">Registration Assistance</option>
                    <option value="Software Support">Software Support</option>
                    <option value="Hardware Support">Hardware Support</option>
                    <option value="Wireless Help">Wireless Help</option>
                    <option value="Other">Other</option>
             </select>
        </td>
    </tr>
    <tr>
    	<td>
        </td>
        <td>
        	<input type="submit" value="Sign In Customer" onclick="if(document.getElementById('reason').value == '0'){alert('You Must Select A Reason'); return false;}else{return true;}" />
        </td>
    </tr>
	</table>
	</form>
</td>
<td width="50%">
	<h4>Last 7 Sign In's</h4>
     <table width="100%">
<tr><td style="border-bottom:solid 1px"><strong>Customer's Name</strong></td><td style="border-bottom:solid 1px"><strong>Signed In By</strong></td></tr>
<?php
$sql = "SELECT * FROM `tbSignins` ORDER BY `iID` DESC LIMIT 0,7";
$q = db::Query($sql);
while($row = $q->fetch()){
	echo "<tr><td>".$row['sCustName']."</td><td>".$row['sTech']."</td></tr>";
}
?>    
</table>
</td>
</tr>
</table>
<?php
include("template_bot.php");
?>